/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.arif.alg.sulamunnayirain;

import java.util.HashMap;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author fii
 */
public class TableConstant {
    public static class Table5{        
        public static final int _1_Muharram=0;
        public static final int _2_Safar=1;
        public static final int _3_RabiulAwwal=2;
        public static final int _4_RabiulAkhir=3;
        public static final int _5_JumadalUla=4;
        public static final int _6_JumadalAkhira=5;
        public static final int _7_Rajab=6;
        public static final int _8_Shaban=7;
        public static final int _9_Ramadan=8;
        public static final int _10_Shawwal=9;
        public static final int _11_DhulQaada=10;
        public static final int _12_DhulHijja=11;
    }
    public static class Table4{        
        public static final int DAROJAH_0=0;    
        public static final int DAROJAH_5=5;    
        public static final int DAROJAH_10=10;    
        public static final int DAROJAH_15=15;    
        public static final int DAROJAH_20=20;    
        public static final int DAROJAH_25=25;    
        public static final int BURUJ_0=11;    
        public static final int BURUJ_1=10;    
        public static final int BURUJ_2=9;    
        public static final int BURUJ_3=8;    
        public static final int BURUJ_4=7;    
        public static final int BURUJ_5=6;    
        public static final int BURUJ_6=5;    
        public static final int BURUJ_7=4;    
        public static final int BURUJ_8=3;    
        public static final int BURUJ_9=2;    
        public static final int BURUJ_10=1;    
        public static final int BURUJ_11=0;    
        
        
    }
    public static class Table3{
        public static final int COL_ALAMAT_7=11;
        public static final int COL_ALAMAT_24=10;
        public static final int COL_ALAMAT_60=9;
        public static final int COL_ALKHASO_12=8;
        public static final int COL_ALKHASO_30=7;
        public static final int COL_ALKHASO_60=6;
        public static final int COL_ALKhoSO_12=5;    
        public static final int COL_ALKhoSO_30=4;    
        public static final int COL_ALKhoSO_60=3;    
        public static final int COL_ALMARKAZ_12=2;    
        public static final int COL_ALMARKAZ_30=1;    
        public static final int COL_ALMARKAZ_60=0;
                
        public static final int _1_Muharram=0;
        public static final int _2_Safar=1;
        public static final int _3_RabiulAwwal=2;
        public static final int _4_RabiulAkhir=3;
        public static final int _5_JumadalUla=4;
        public static final int _6_JumadalAkhira=5;
        public static final int _7_Rajab=6;
        public static final int _8_Shaban=7;
        public static final int _9_Ramadan=8;
        public static final int _10_Shawwal=9;
        public static final int _11_DhulQaada=10;
        public static final int _12_DhulHijja=11;
        public static final int _1_Muharram_new=12;
        
        
    }
    /**
     * 		private final String[] months = {"Muharram", "Safar", "RabiulAwwal",  
	            "Rabi'ul Akhir", "Jumadal Ula", "Jumadal Akhira", "Rajab",  
	            "Sha'ban", "Ramadan", "Shawwal", "Dhul Qa'ada", "Dhul Hijja"};
		private final int[] daysOfMonth = {30,29,30,29,30,29,30,29,30,29,30,29};
     */
    public static class Table2{
        public static final int COL_ALAMAT_7=14;
        public static final int COL_ALAMAT_24=13;
        public static final int COL_ALAMAT_60=12;
        public static final int COL_ALKHASO_12=11;
        public static final int COL_ALKHASO_30=10;
        public static final int COL_ALKHASO_60=9;
        public static final int COL_ALKhoSO_12=8;    
        public static final int COL_ALKhoSO_30=7;    
        public static final int COL_ALKhoSO_60=6;    
        public static final int COL_ALMARKAZ_12=5;    
        public static final int COL_ALMARKAZ_30=4;    
        public static final int COL_ALMARKAZ_60=3;
        public static final int COL_ALAWJ_12=2;    
        public static final int COL_ALAWJ_30=1;    
        public static final int COL_ALAWJ_60=0;    
    }
    public static class Table1{
        public static final int COL_ALAMAT_7=14;
        public static final int COL_ALAMAT_24=13;
        public static final int COL_ALAMAT_60=12;
        public static final int COL_ALKHASO_12=11;
        public static final int COL_ALKHASO_30=10;
        public static final int COL_ALKHASO_60=9;
        public static final int COL_ALKhoSO_12=8;    
        public static final int COL_ALKhoSO_30=7;    
        public static final int COL_ALKhoSO_60=6;    
        public static final int COL_ALMARKAZ_12=5;    
        public static final int COL_ALMARKAZ_30=4;    
        public static final int COL_ALMARKAZ_60=3;
        public static final int COL_ALAWJ_12=2;    
        public static final int COL_ALAWJ_30=1;    
        public static final int COL_ALAWJ_60=0;    
    }
    
    private static TableConstant instance;    
    private HashMap<Integer,Row> table1;    
    private HashMap<Integer,Row> table2;    
    private HashMap<Integer,Row> table3;    
    private HashMap<Integer,Row> table4;    
    private HashMap<Integer,Row> table5;    
    private HashMap<Integer,Row> table6;    
    private int[][] table7;    
    private HashMap<Integer,Row> table8;    
    private HashMap<Integer,Row> table9;    
    private HashMap<Integer,Row> table10;    
    
    public static TableConstant getInstance(){
        if(instance==null){
            instance=new TableConstant();
        }
        return instance;
    }
    private HashMap initTable(int rows, int cols, int[][] values, HashMap table, Object[] keys) throws Exception{
        for(int i=0;i<rows;i++){
            Row row=new Row(cols);
            for(int j=0;j<cols;j++){
                row.set(j, values[i][j]);            
            }                
            table.put(keys[i], row);
        }                
        return table;
    }
    private void initTable6() throws Exception{
            final int banyakKolom=24;
            table6=new HashMap<Integer,Row>();            
            final Integer[] keys=new Integer[30];
                for(int i=0;i<30;i++){
                    keys[i]=i;
                }
            final int banyakBaris=keys.length;
            int[][] arrayValue={
                {18, 7, 7, 9, 59, 9, 29, 9, 41, 7, 59, 4, 19, 2, 30, 0, 2, 0, 52, 0, 41, 2, 59, 4},
                {15, 7, 4, 9, 59, 9, 31, 9, 46, 7, 5, 5, 23, 2, 30, 0, 2, 0, 49, 0, 36, 2, 54, 4},
                {9, 7, 1, 9, 58, 9, 33, 9, 50, 7, 11, 5, 27, 2, 35, 0, 1, 0, 47, 0, 32, 2, 50, 4},
                {5, 7, 58, 8, 57, 9, 36, 9, 55, 7, 16, 5, 32, 2, 37, 0, 1, 0, 44, 0, 28, 2, 45, 4},
                {0, 7, 55, 8, 57, 9, 38, 9, 59, 7, 22, 5, 37, 2, 40, 0, 0, 0, 41, 0, 24, 2, 40, 4},
                {56, 6, 52, 8, 56, 9, 40, 9, 3, 8, 27, 5, 43, 2, 43, 0, 0, 0, 38, 0, 20, 2, 35, 4},
                {52, 6, 49, 8, 55, 9, 41, 9, 8, 8, 33, 5, 48, 2, 46, 0, 0, 0, 36, 0, 15, 2, 30, 4},
                {48, 6, 46, 8, 53, 9, 42, 9, 12, 8, 39,5, 57, 2, 49, 0, 0, 0, 34, 0, 11, 2, 25, 4},
                {43, 6, 43, 8, 52, 9, 44, 9, 17, 8, 45, 5, 58, 2, 52, 0, 1, 0, 32, 0, 7, 2, 20, 4},
                {39, 6, 40, 8, 50, 9, 46, 9, 21, 8, 50, 5, 3, 3, 55, 0, 1, 0, 29, 0, 3, 2, 15, 4},
                {35, 6, 36, 8, 48, 9, 48, 9, 25, 8, 56, 5, 8, 3, 58, 0, 2, 0, 27, 0, 59, 1, 11, 4},
                {30, 6, 33, 8, 47, 9, 49, 9, 29, 8, 2, 6, 13, 3, 2, 1, 2, 0, 26, 0, 55, 1, 6, 4},
                {24, 6, 29, 8, 45, 9, 50, 9, 33, 8, 8, 6, 19, 3, 5, 1, 3, 0, 25, 0, 51, 1, 1, 4},
                {21, 6, 25, 8, 44, 9, 51, 9, 37, 8, 13, 6, 24,3, 9, 1, 4, 0, 23, 0, 47, 1, 56, 3},
                {16, 6, 22, 8, 43, 9, 52, 9, 41, 8, 19, 6, 29, 3, 12, 1, 5, 0, 21, 0, 43, 1, 51, 3},
                {11, 6, 18, 8, 41, 9, 53, 9, 44, 8, 24, 6, 35, 3, 15, 1, 6, 0, 18, 0, 40, 1, 47, 3},
                {6, 6, 15, 8, 39, 9, 54, 9, 48, 8, 30, 6, 40, 3, 19, 1, 7, 0, 17, 0, 37, 1, 43, 3},
                {1, 6, 11, 8, 37, 9, 55, 9, 51, 8, 35, 6, 45, 3, 23, 1, 8, 0, 16, 0, 33, 1, 38, 3},
                {57, 5, 7, 8, 35, 9, 56, 9, 54, 8, 40, 6, 51, 3, 27, 1, 9, 0, 15, 0, 29, 1, 33, 3},
                {52, 5, 3, 8, 33, 9, 57, 9, 58, 8, 45, 6, 56, 3, 31, 1, 10, 0, 13, 0, 26, 1, 28, 3},
                {47, 5, 59, 7, 31, 9, 57, 9, 1, 9, 50, 6, 2, 4, 35, 1, 11, 0, 11, 0, 23, 1, 24, 3},
                {42, 5, 55, 7, 29, 9, 58, 9, 4, 9, 56, 6, 7, 4, 39, 1, 12, 0, 9, 0, 19, 1, 19, 3},
                {37, 5, 51, 7, 27, 9, 58, 9, 7, 9, 1, 7, 12, 4, 43, 1, 15, 0, 8, 0, 16, 1, 15, 3},
                {33, 5, 47, 7, 25, 9, 59, 9, 10, 9, 6, 7, 17, 4, 47, 1, 16, 0, 7, 0, 13, 1, 11, 3},
                {28, 5, 43, 7, 23, 9, 59, 9, 13, 9, 11, 7, 22, 4, 51, 1, 18, 0, 6, 0, 10, 1, 7, 3},
                {23, 5, 39, 7, 20, 9, 0, 10, 16, 9, 16, 7, 27, 4, 56, 1, 19, 0, 5, 0, 7, 1, 3, 3},
                {18, 5, 35, 7, 17, 9, 0, 10, 19, 9, 21, 7, 33, 4, 0, 2, 21, 0, 4, 0, 4, 1, 58, 2},
                {13, 5, 31, 7, 15, 9, 0, 10, 21, 9, 26, 7, 39, 4, 5, 2, 23, 0, 3, 0, 1, 1, 54, 2},
                {9, 5, 27, 7, 13, 9, 59, 9, 27, 9, 31, 7, 46, 4, 9, 2, 25, 0, 3, 0, 58, 0, 49, 2},
                {4, 5, 23, 7, 10, 9, 59, 9, 26, 9, 36, 7, 52, 4, 14, 2, 27, 0, 2, 0, 55, 0, 45, 2}
            };                                    
            table6=this.initTable(banyakBaris, banyakKolom, arrayValue, table6, keys);
            
    }
    private void initTable4() throws Exception{
            final int banyakKolom=12;
            table4=new HashMap<Integer,Row>();            
            final Integer[] keys={0,5,10,15,20,25};
            final int banyakBaris=keys.length;
            int[][] arrayValue={
                {0, 2, 9, 16, 17, 13, 7, 6, 8, 11, 9, 4},
                {1, 1, 7, 15, 17, 13, 8, 5, 8, 11, 10, 5},
                {1, 1, 6, 14, 17, 14, 9, 6, 7, 10, 10, 6},
                {2, 0, 5, 13, 17, 15, 10, 6, 7, 10, 11, 7},
                {3, 0, 4, 11, 17, 16, 11, 6, 6, 9, 11, 8},
                {3, 0, 3, 10, 16, 16, 12, 7, 6, 9, 11, 9}
            };                                    
            table4=this.initTable(banyakBaris, banyakKolom, arrayValue, table4, keys);
            
    }
    private void initTable7() throws Exception{
            final int banyakKolom=18;            
            final int max_row=37;
            table7=new int[max_row][banyakKolom];            
            final int banyakBaris=max_row;
            int[][] arrayValue={
                {0, 0, 12, 2, 52, 11, 48, 40, 40, 15, 45, 15, 51, 11, 13, 2, 0, 0},
                {25, 11, 12, 2, 53, 11, 49, 40, 41, 15, 45, 15, 51, 11, 13, 2, 5, 0},
                {20, 11, 12, 2, 55, 11, 50, 40, 42, 15, 46, 15, 51, 11, 13, 2, 10, 0},
                {15, 11, 12, 2, 57, 11, 52, 40, 43, 15, 46, 15, 52, 11, 13, 2, 15, 0},
                {10, 11, 11, 2, 59, 11, 55, 40, 45, 15, 46, 15, 52, 11, 12, 2, 20, 0},
                {5, 11, 10, 2, 19, 12, 59, 40, 46, 15, 47,15, 54, 11, 12, 2, 25, 0},
                {0, 11, 9, 2, 5, 12, 4, 41, 49, 15, 47, 15, 55, 11, 12, 2, 0, 1},
                {25, 10, 8, 2, 9, 12, 10, 41, 52, 15, 48, 15, 57, 11, 12, 2, 5, 1},
                {20, 10, 7, 2, 14, 12, 18, 41, 56, 15, 49, 15, 0, 12, 11, 2, 10, 1},
                {15, 10, 6, 2, 18, 12, 27, 41, 0, 16, 50, 15, 3, 12, 10, 2, 15, 1},
                {10, 10, 6, 2, 23, 12, 37, 41, 0, 16, 51, 15, 7, 12, 10, 2, 20, 1},
                {5, 10, 4, 2, 28, 12, 48, 41, 8, 16, 52, 15, 11, 12, 10, 2, 25, 1},
                {0, 10, 3, 2, 24, 12, 0, 42, 13, 16, 53, 15, 15, 12, 9, 2, 0, 2},
                {25, 9, 2, 2, 40, 12, 17, 42, 18, 16, 54, 15, 20, 12, 8, 2, 5, 2},
                {20, 9, 1, 2, 47, 12, 24, 42, 23, 16, 55, 15, 26, 12, 7, 2, 10, 2},
                {15, 9, 0, 2, 54, 12, 37, 42, 30, 16, 57, 15, 32, 12, 6, 2, 15, 2},
                {10, 9, 59, 1, 0, 13, 51, 42, 36, 16, 58, 15, 39, 12, 5, 2, 20, 2},
                {5, 9, 59, 1, 9, 13, 6, 43, 41, 16, 58, 15, 44, 12, 4, 2, 25, 2},
                {0, 9, 58, 1, 15, 13, 21, 43, 47, 16, 1, 16, 50, 12, 3, 2, 0, 3},
                {25, 8, 56, 1, 23, 13, 37, 43, 54, 16, 2, 16, 58, 12, 2, 2, 5, 3},
                {20, 8, 55, 1, 31, 13, 52, 43, 0, 17, 2, 16, 4, 13, 1, 2, 10, 3},
                {15, 8, 54, 1, 39, 13, 7, 44, 7, 17, 5, 16, 12, 13, 59, 1, 15, 3},
                {10, 8, 53, 1, 45, 13, 28, 44, 17, 17, 7, 16, 22, 13, 57, 1, 20, 3},
                {5, 8, 52, 1, 55, 13, 39, 44, 21, 17, 8, 16, 28, 13, 56, 1, 25, 3},
                {0, 8, 51, 1, 58, 13, 57, 44, 27, 17, 9, 16, 37, 13, 55, 1, 0, 4},
                {25, 7, 50, 1, 8, 14, 9, 45, 37, 17, 10, 16, 44, 13, 54, 1, 5, 4},
                {20, 7, 48, 1, 47, 14, 24, 45, 40, 17, 12, 16, 54, 13, 53, 1, 10, 4},
                {15, 7, 48, 1, 21, 14, 37, 45, 45, 17, 13, 16, 8, 14, 52, 1, 15, 4},
                {10, 7, 47, 1, 28, 14, 49, 45, 50, 17, 14, 16, 13, 14, 50, 1, 20, 4},
                {5, 7, 46, 1, 33, 14, 0, 46, 55, 17, 15, 16, 20, 14, 50, 1, 25, 4},
                {0, 7, 46, 1, 36, 14, 9, 46, 0, 18, 15, 16, 26, 14, 49, 1, 0, 5},
                {25, 6, 45, 1, 41, 14, 17, 46, 5, 18, 16, 16, 33, 14, 48, 1, 5, 5},
                {20, 6, 45, 1, 43, 14, 25, 46, 7, 18, 17, 16, 36, 14, 47, 1, 10, 5},
                {15, 6, 45, 1, 43, 14, 30, 46, 10, 18, 17, 16, 40, 14, 46, 1, 15, 5},
                {10, 6, 45, 1, 44, 14, 33, 46, 12, 18, 17, 16, 42, 14, 46, 1, 20, 5},
                {5, 6, 45, 1, 44, 14, 37, 46, 14, 18, 18, 16, 43, 14, 45, 1, 25, 5},
                {0, 6, 45, 1, 43, 14, 42, 46, 15, 18, 18, 16, 43, 14, 45, 1, 0, 6}
            };                                    
            for(int i=0;i<max_row;i++){
                for(int j=0;j<banyakKolom;j++){
                    table7[i][j]=arrayValue[i][j];
                }
            }
    }
    private void initTable5() throws Exception{
            final int banyakKolom=24;
            table5=new HashMap<Integer,Row>();            
            final Integer[] keys=new Integer[30];
                for(int i=0;i<30;i++){
                    keys[i]=i;
                }
            //{0,1,2,3,4,5,6,7,8,9,10,11,12};
            final int banyakBaris=keys.length;
            int[][] arrayValue={
                {0, 1, 18, 0, 0, 0, 14, 0, 56, 0, 56, 1, 56, 2, 39, 3, 52, 3, 35, 3, 53, 2, 56, 1}, 
                {2, 1, 19, 0, 0, 0, 13, 0, 54, 0, 55, 1, 54, 2, 38, 3, 52, 3, 36, 3, 55, 2, 59, 1}, 
                {4, 1, 20, 0, 0, 0, 12, 0, 52, 0, 53, 1, 52, 2, 37, 3, 52, 3, 37, 3, 57, 2, 1, 2}, 
                {5, 1, 22, 0, 0, 0, 11, 0, 50, 0, 51, 1, 51, 2, 36, 3, 52, 3, 38, 3, 58, 2, 3, 2}, 
                {7, 1, 23, 0, 1, 0, 10, 0, 48, 0, 48, 1, 49, 2, 35, 3, 52, 3, 39, 3, 59, 2, 5, 2}, 
                {9, 1, 24, 0, 1, 0, 9, 0, 47, 0, 46, 1, 47, 2, 34, 3, 52, 3, 40, 3, 1, 3, 6, 2}, 
                {11, 1, 25, 0, 1, 0, 9, 0, 45, 0, 44, 1, 45, 2, 33, 3, 52, 3, 41, 3, 3, 3, 8, 2}, 
                {13, 1, 26, 0, 2, 0, 8, 0, 43, 0, 42, 1, 43, 2, 32, 3, 52, 3, 41, 3, 5, 3, 10, 2}, 
                {14, 1, 28, 0, 2, 0, 7, 0, 42, 0, 40, 1, 42, 2, 30, 3, 52, 3, 42, 3, 7, 3, 12, 2}, 
                {16, 1, 29, 0, 2, 0, 7, 0, 40, 0, 38, 1, 40, 2, 29, 3, 52, 3, 43, 3, 8, 3, 14, 2}, 
                {18, 1, 30, 0, 3, 0, 6, 0, 39, 0, 36, 1, 38, 2, 28, 3, 52, 3, 44, 3, 9, 3, 16, 2}, 
                {20, 1, 31, 0, 3, 0, 6, 0, 37, 0, 34, 1, 36, 2, 27, 3, 51, 3, 45, 3, 10, 3, 18, 2}, 
                {22, 1, 33, 0, 4, 0, 5, 0, 36, 0, 32, 1, 34, 2, 25, 3, 51, 3, 46, 3, 12, 3, 19, 2}, 
                {23, 1, 34, 0, 4, 0, 4, 0, 35, 0, 29, 1, 32, 2, 24, 3, 51, 3, 46, 3, 13, 3, 21, 2}, 
                {24, 1, 36, 0, 5, 0, 4, 0, 33, 0, 27, 1, 30, 2, 22, 3, 50, 3, 47, 3, 15, 3, 23, 2}, 
                {27, 1, 37, 0, 6, 0, 3, 0, 32, 0, 25, 1, 28, 2, 21, 3, 50, 3, 48, 3, 16, 3, 25, 2}, 
                {29, 1, 38, 0, 6, 0, 3, 0, 30, 0, 23, 1, 26, 2, 19, 3, 49, 3, 48, 3, 17, 3, 27, 2}, 
                {31, 1, 40, 0, 7, 0, 2, 0, 29, 0, 21, 1, 23, 2, 18, 3, 48, 3, 48, 3, 19, 3, 29, 2}, 
                {33, 1, 41, 0, 7, 0, 2, 0, 28, 0, 19, 1, 21, 2, 17, 3, 48, 3, 49, 3, 20, 3, 31, 2}, 
                {35, 1, 43, 0, 8, 0, 1, 0, 26, 0, 17, 1, 19, 2, 15, 3, 47, 3, 49, 3, 21, 3, 32, 2}, 
                {37, 1, 44, 0, 9, 0, 1, 0, 25, 0, 15, 1, 17, 2, 14, 3, 47, 3, 50, 3, 23, 3, 35, 2}, 
                {39, 1, 46, 0, 9, 0, 1, 0, 24, 0, 13, 1, 15, 2, 12, 3, 46, 3, 50, 3, 24, 3, 37, 2}, 
                {41, 1, 47, 0, 10, 0, 1, 0, 23, 0, 11, 1, 13, 2, 10, 3, 45, 3, 51, 3, 26, 3, 39, 2}, 
                {43, 1, 49, 0, 11, 0, 0, 0, 21, 0, 10, 1, 11, 2, 8, 3, 45, 3, 51, 3, 27, 3, 40, 2}, 
                {45, 1, 50, 0, 12, 0, 0, 0, 20, 0, 8, 1, 9, 2, 7, 3, 44, 3, 51, 3, 28, 3, 42, 2}, 
                {46, 1, 52, 0, 13, 0, 0, 0, 19, 0, 6, 1, 7, 2, 5, 3, 43, 3, 52, 3, 30, 3, 44, 2}, 
                {48, 1, 53, 0, 14, 0, 0, 0, 18, 0, 4, 1, 5, 2, 3, 3, 43, 3, 52, 3, 31, 3, 46, 2}, 
                {50, 1, 55, 0, 15, 0, 0, 0, 17, 0, 2, 1, 3, 2, 1, 3, 42, 3, 52, 3, 32, 3, 48, 2}, 
                {52, 1, 56, 0, 16, 0, 0, 0, 16, 0, 0, 1, 1, 2, 59, 2, 41, 3, 52, 3, 33, 3, 50, 2}, 
                {54, 1, 58, 0, 17, 0, 0, 0, 15, 0, 58, 0, 59, 1, 57, 2, 40, 3, 52, 3, 34, 3, 51, 2} 
            };                                    
            table5=this.initTable(banyakBaris, banyakKolom, arrayValue, table5, keys);            
    }
    private void initTable3() throws Exception{
            final int banyakKolom=15;
            table3=new HashMap<Integer,Row>();            
            final Integer[] keys={0,1,2,3,4,5,6,7,8,9,10,11,12};
            final int banyakBaris=keys.length;
            int[][] arrayValue={
                {0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0,6, 29, 0, 49, 25, 0, 40, 0, 1, 44, 12, 1},
                {0, 0, 0,13, 28, 1, 38, 21, 1, 20, 1, 2, 28, 1, 3},
                {0, 0, 0,19, 27, 2, 26, 17, 2, 1, 2, 3, 12, 14, 4},
                {0, 0, 0,26, 26, 3, 16, 13, 3, 41, 2, 4, 56, 2, 6},
                {0, 0, 0,32, 25, 4, 5, 9, 4, 21, 3, 5, 40, 15, 7},
                {0, 0, 0,38, 24, 5, 54, 4, 5, 1, 4, 6, 24, 4, 2},
                {0, 0, 0,45, 23, 6, 43, 0, 6, 42, 4, 7, 8, 17, 3},
                {0, 0, 0,51, 22, 7, 32, 26, 6, 22, 5, 8, 52, 5, 5},
                {0, 0, 0,57, 21, 8, 21, 22, 7, 3, 6, 9, 36, 18, 6},
                {0, 0, 0,4, 21, 9, 10, 18, 8, 43, 6, 10, 20, 7, 1},
                {0, 0, 0,10, 20, 10, 59, 13, 9, 23, 7, 11, 4, 20, 2},
                {0, 0, 0,16, 19, 11, 48, 9, 10, 3, 8, 0, 48, 8, 4}
            };                                    
            table3=this.initTable(banyakBaris, banyakKolom, arrayValue, table3, keys);
            
    }
    private void initTable2() throws Exception{
            final int banyakKolom=15;
            table2=new HashMap<Integer,Row>();            
            final Integer[] keys={1,2,3,4,5,6,7,8,9,10};
            final int banyakBaris=keys.length;
            int[][] arrayValue={
                {0, 0, 0, 16, 19, 11, 48, 9, 10, 3, 8, 0, 48, 8, 4},
                {2, 0, 0, 32, 8, 11, 36, 19, 8, 6, 16, 0, 37, 17, 1},
                {2, 0, 0, 48, 27, 10, 24, 29, 6, 9, 24, 0, 25, 2, 6},
                {3, 0, 0, 4, 17, 10, 12, 9, 5, 12, 2, 1, 14, 11, 3},
                {4, 0, 0, 20, 6, 10, 0, 19, 3, 15, 10, 1, 2, 20, 7},
                {5, 0, 0, 36, 25, 9, 48, 28, 1, 18, 18, 1, 51, 4, 5},
                {6, 0, 0, 52, 14, 9, 36, 8, 0, 21, 26, 1, 39, 13, 2},
                {6, 0, 0, 8, 4, 9, 24, 18, 10, 24, 4, 2, 28, 22, 6},
                {7, 0, 0, 24, 23, 8, 12, 28, 8, 27, 12, 2, 16, 7, 4},
                {8, 0, 0, 40, 12, 8, 0, 8, 7, 30, 20, 2, 5, 16, 1}
            };                                    
            table2=this.initTable(banyakBaris, banyakKolom, arrayValue, table2, keys);
            
    }
    private void initTable1() throws Exception{
            final int banyakKolom=15;
            table1=new HashMap<Integer, Row>();
            final Integer[] keys={1370,1380,1390,1400,1410,1420,1430,1440};
            final int banyakBaris=keys.length;
            int[][] arrayValue={
                {38, 11, 3, 10, 9, 4, 13, 20, 5, 33, 25, 7, 34, 1, 7},
                {46, 11, 3, 50, 21, 0, 13, 28, 0, 3, 16, 10, 39, 17, 1},
                {54, 11, 3, 30, 4, 9, 13, 6, 8, 33, 6, 1, 44, 9, 3},
                {2, 12, 3, 10, 17, 5, 13, 14, 3, 3, 27, 3, 49, 1, 5},
                {10, 12, 3, 50, 29, 1, 13, 22, 10, 33, 17, 6, 54, 17, 6},
                {18, 12, 3, 30, 12, 10, 13, 0, 6, 3, 8, 9, 59, 9, 1},
                {26, 12, 3, 10, 25, 6, 13, 8, 1, 33, 28, 11, 4, 2, 3},
                {34, 12, 3, 50, 7, 3, 13, 16, 8, 3, 19, 2, 9, 18, 4}
            };                                    
            table1=this.initTable(banyakBaris, banyakKolom, arrayValue, table1, keys);
            
    }
    private void initTable10() throws Exception{
            final int banyakKolom=12;
            table10=new HashMap<Integer, Row>();
            final Integer[] keys=new Integer[31];
                for(int i=1;i<=31;i++){
                    keys[i-1]=i;
                }
            final int banyakBaris=keys.length;            
            int[][] arrayValue={
                {6, 2, 10, 6, 1, 10, 6, 2, 10, 6, 1, 10},
                {7, 3, 11, 7, 2, 11, 7, 3, 11, 7, 2, 11},
                {8, 4, 12, 8, 3, 12, 8, 4, 12, 8, 3, 12},
                {9, 5, 13, 9, 4, 13, 9, 5, 13, 9, 4, 13},
                {10, 6, -1, 10, 5, -1, 10, 6, -1, 10, 5, -1},
                {11, 7, 2, 11, 6, 2, 11, 7, 2, 11, 6, 2},
                {12, 8, 3, 12, 7, 3, 12, 8, 3, 12, 7, 3},
                {13, 9, 4, 13, 8, 4, 13, 9, 4, 13, 8, 4},
                {-1, 10, 5, -1, 9, 5, 14, 10, 5, -1, 9, 5},
                {2, 11, 6, 2, 10, 6, -1, 11, 6, 2, 10, 6},
                {3, 12, 7, 3, 11, 7, 2, 12, 7, 3, 11, 7},
                {4, 13, 8, 4, 12, 8, 3, 13, 8, 4, 12, 8},
                {5, -1, 9, 5, 13, 9, 4, -1, 9, 5, 13, 9},
                {6, 2, 10, 6, -1, 10, 5, 2, 10, 6, -1, 10},
                {7, 3, 11, 7, 2, 11, 6, 3, 11, 7, 2, 11},
                {8, 4, 12, 8, 3, 12, 7, 4, 12, 8, 3, 12},
                {9, 5, 13, 9, 4, 13, 8, 5, 13, 9, 4, 13},
                {10, 6, -1, 10, 5, -1, 9, 6, -1, 10, 5, -1},
                {11, 7, 2, 11, 6, 2, 10, 7, 2, 11, 6, 2},
                {12, 8, 3, 12, 7, 3, 11, 8, 3, 12, 7, 3},
                {13, 9, 4, 13, 8, 4, 12, 9, 4, 13, 8, 4},
                {-1, 10, 5, -1, 9, 5, 13, 10, 5, -1, 9, 5},
                {2, 11, 6, 2, 10, 6, -1, 11, 6, 2, 10, 6},
                {3, 12, 7, 3, 11, 7, 2, 12, 7, 3, 11, 7},
                {4, 13, 8, 4, 12, 8, 3, 13, 8, 4, 12, 8},
                {5, -1, 9, 5, 13, 9, 4, -1, 9, 5, 13, 9},
                {6, 2, 10, 6, -1, 10, 5, 2, 10, 6, -1, 10},
                {7, 3, 11, 7, 2, 11, 6, 3, 11, 7, 2, 11},
                {8, 4, 12, 8, 3, 12, 7, 4, 12, 8, 3, 12},
                {9, 5, 13, 9, 4, 13, 8, 5, 13, 9, 4, 13},
                {0, 0, -1, 0, 5, 0, 9, 0, -1, 0, 5, 0}
            };                                    
            table10=this.initTable(banyakBaris, banyakKolom, arrayValue, table10, keys);
            
    }
    private void initTable9() throws Exception{
            final int banyakKolom=7;
            table9=new HashMap<Integer, Row>();            
            final Integer[] keys=new Integer[30];
                for(int i=0;i<30;i++){
                    keys[i]=i;
                }
            final int banyakBaris=keys.length;
            int[][] arrayValue={
                {30, 20, 4, 30, 2, 0, 0, 0},
                {29, 23, 4, 35, 2, 5, 0, 1},
                {28, 25, 4, 39, 2, 11, 0, 2},
                {27, 27, 4, 44, 2, 16, 0, 3},
                {26, 30, 4, 48, 2, 22, 0, 4},
                {25, 32, 4, 52, 2, 26, 0, 5},
                {24, 34, 4, 56, 2, 31, 0, 6},
                {23, 36, 4, 1, 3, 37, 0, 7},
                {22, 38, 4, 5, 3, 42, 0, 8},
                {21, 40, 4, 9, 3, 47, 0, 9},
                {20, 42, 4, 13, 3, 52, 0, 10},
                {19, 44, 4, 17, 3, 57, 0, 11},
                {18, 45, 4, 21, 3, 3, 1, 12},
                {17, 46, 4, 25, 3, 8, 1, 13},
                {16, 48, 4, 28, 3, 13, 1, 14},
                {15, 50, 4, 32, 3, 18, 1, 15},
                {14, 51, 4, 36, 3, 23, 1, 16},
                {13, 52, 4, 40, 3, 28, 1, 17},
                {12, 54, 4, 43, 3, 33, 1, 18},
                {11, 55, 4, 47, 3, 38, 1, 19},
                {10, 55, 4, 50, 3, 43, 1, 20},
                {9, 56, 4, 53, 3, 48, 1, 21},
                {8, 57, 4, 57, 3, 53, 1, 22},
                {7, 58, 4, 0, 4, 58, 1, 23},
                {6, 59, 4, 3, 4, 2, 2, 24},
                {5, 59, 4, 6, 4, 4, 2, 25},
                {4, 0, 5, 9, 4, 12, 2, 26},
                {3, 0, 5, 12, 4, 16, 2, 27},
                {2, 0, 5, 15, 4, 21, 2, 28},
                {1, 0, 5, 17, 4, 26, 2, 29}
            };                                    
            table9=this.initTable(banyakBaris, banyakKolom, arrayValue, table9, keys);
            
    }
    private void initTable8() throws Exception{
            final int banyakKolom=5;
            // kolom 5 flag apakah ditambah/dikurangi
            // -1 dikurangi
            // 1 ditambah
            // 0 -> Jakarta
            table8=new HashMap<Integer, Row>();
            final Integer[] keys=new Integer[27];
            for(int i=0;i<27;i++){
                keys[i]=i;
            }
            final int banyakBaris=keys.length;
            int[][] arrayValue={
                {4, 0, 6, 4,-1},
                {4, 0, 6, 23,-1},
                {3, 0, 6, 1,-1},
                {2, 0, 6, 24,-1},
                {3, 0, 6, 7,-1},
                {3, 0, 6, 21,-1},
                {0, 0, 6, 35,-1},
                {0, 0, 6, 10,0},
                {0, 0, 6, 15,1},
                {2, 0, 6, 18,1},
                {2, 0, 6, 34,1},
                {3, 0, 6, 55,1},
                {7, 0, 6, 42,1},
                {14, 0, 7, 48,1},
                {11, 0, 6, 58,1},
                {14, 0, 6, 35,1},
                {14, 0, 7, 74,1},
                {16, 0, 6, 48,1},
                {19, 0, 6, 42,1},
                {21, 0, 6, 48,1},
                {24, 0, 7, 14,1},
                {22, 0, 7, 32,1},
                {24, 0, 7, 34,1},
                {26, 0, 7, 45,1},
                {30, 0, 7, 12,1},
                {28, 0, 6, 1,1},
                {22, 0, 7, 13,1}
                
            };                                    
            table8=this.initTable(banyakBaris, banyakKolom, arrayValue, table8, keys);
            
    }
    public TableConstant() {
        try {
            this.initTable1();
            this.initTable2();
            this.initTable3();  
            this.initTable4();
            this.initTable5();
            this.initTable6();
            this.initTable7();
            this.initTable8();
            this.initTable9();
            this.initTable10();
        } catch (Exception ex) {
            Logger.getLogger(TableConstant.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    public Row getTable7(int derajat, int buruj) throws Exception{                
            final int banyakKolom=18;            
            final int max_row=37;
            int tm=derajat/5;
            tm = (tm+1) * 5;
            if(derajat < tm){
            	derajat = tm - 5;
            }
            int kolomBuruj =banyakKolom-1;
            int kolomDerajat =banyakKolom-2;            
            int baris=0;
//            switch(derajat){
//                case 25:
//                    tm=5;
//                    break;
//                case 20:
//                    tm=10;
//                    break;
//                case 15:
//                    tm=15;
//                    break;  
//                case 10:
//                    tm=20;
//                    break;
//                case 5:
//                    tm=25;
//                    break;
//            }
            if(derajat>=0 && buruj >=6){
                kolomDerajat =0;
                kolomBuruj =1;
            }
            for(int i=0;i<max_row;i++){     
                int dr = table7[i][kolomDerajat];
                int bj = table7[i][kolomBuruj];
                if(dr==derajat && bj==buruj){
                    baris=i;
                    break;
                }
            }
            Row r=new Row(banyakKolom);
            for(int i=0;i<banyakKolom;i++){                
                    r.set(i, table7[baris][i]);
            }
            return r;            
    }
    public Row getTable(int table,int key) throws Exception{
        HashMap<Integer,Row> t=null;
        switch(table)    {
            case 1:
                t=table1;
                break;
            case 2:
                t=table2;
                break;
            case 3:
                t=table3;
                break;
            case 4:
                t=table4;
                break;        
            case 5:
                t=table5;
                break;
            case 6:
                t=table6;
                break;            
            case 8:
                t=table8;
                break;        
            case 9:
                t=table9;
                break;
            case 10:
                t=table10;
                break;        
                
        }
        return t.get(key);
    }
    public int getTable(int table,int key,int kolom) throws Exception{
        HashMap<Integer,Row> t=null;
        switch(table)    {
            case 1:
                t=table1;
                break;
            case 2:
                t=table2;
                break;
            case 3:
                t=table3;
                break;
            case 4:
                t=table4;
                break;        
            case 5:
                t=table5;
                break;
            case 6:
                t=table6;
                break;            
            case 8:
                t=table8;
                break;        
            case 9:
                t=table9;
                break;
            case 10:
                t=table10;
                break;        
                
        }
        return t.get(key).get(kolom);
    }
    
    
   
}
